<HTML><HEAD><TITLE>-(+Number, -Result)</TITLE>
</HEAD><BODY>[ <A HREF="index.html">Arithmetic</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>-(+Number, -Result)</H1>
Unifies the negative of Number with Result.


<DL>
<DT><EM>Number</EM></DT>
<DD>A number.
</DD>
<DT><EM>Result</EM></DT>
<DD>A variable or a number.
</DD>
</DL>
<H2>Description</H2>
   This predicate is used by the ECLiPSe compiler to expand evaluable
   arithmetic expressions.  So the call to -(Number, Result) is equivalent
   to
<PRE>
    Result is -Number
</PRE>
    which should be preferred for portability.
<P>
   Number and Result have to be of the same type.

<P>
   In coroutining mode, if Number is uninstantiated, the call to -/2 is
   delayed until this variable is instantiated.

<P>

<H3>Modes and Determinism</H3><UL>
<LI>-(+, -) is det
</UL>
<H3>Exceptions</H3>
<DL>
<DT><EM>(4) instantiation fault </EM>
<DD>Number is not instantiated (non-coroutining mode only).
<DT><EM>(24) number expected </EM>
<DD>Number is not of a numeric type.
</DL>
<H2>Examples</H2>
<PRE>
Success:
      -(1, -1).
      -(5, Result).        (gives Result = -5)
      -(-6.2, Result).     (gives Result = 6.2)
Fail:
      -(1, 0).
      -(1, -1.0).
      -(1.0, -1).
      -(1, r).
Error:
      -(A, 6).                   (Error 4).
      -(4 + 2, -6).              (Error 24).



</PRE>
<H2>See Also</H2>
<A HREF="../../kernel/arithmetic/is-2.html">is / 2</A>
</BODY></HTML>
